package cn.itcast.work.dao.content;


import cn.itcast.work.pojo.Text_show;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ContentMapper {
    /**
     * 联合text users 表 查出结果 赋给工具类
     * @param id
     * @return
     */
    @Select("select userName, text.phone, title, subtitle, content, createdate, cname, mname from text join users on" +
            " users.phone = text.phone join aCategory on aCategory.id=text.mid join category2 on category2.id=text.cid where text.mid=#{id}")
    public List<Text_show> selectConText(@Param("id") Integer id);
}
